package cn.owng.server.common.generated.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 角色信息
 * </p>
 *
 * @author baomidou
 * @since 2024-08-11
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("role")
public class Role extends Model<Role> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "role_id", type = IdType.ASSIGN_ID)
    private Integer roleId;

    /**
     * 角色名称, 例如: 管理员、运营人员、玩家等
     */
    @TableField("name")
    private String name;

    /**
     * 角色描述
     */
    @TableField("description")
    private String description;

    /**
     * 角色权限
     */
    @TableField("permissions")
    private String permissions;

    /**
     * 角色菜单
     */
    @TableField("menus")
    private String menus;

    /**
     * 状态: 0=禁用, 1=正常
     */
    @TableField("status")
    private Integer status;

    /**
     * 添加时间
     */
    @TableField("date_added")
    private Date dateAdded;

    /**
     * 更新时间
     */
    @TableField("date_modified")
    private Date dateModified;

    @Override
    public Serializable pkVal() {
        return this.roleId;
    }
}
